package com.ligotop.admin.system.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ligotop.admin.system.entity.Menu;
import com.ligotop.admin.system.mapper.MenuMapper;
import com.ligotop.admin.system.service.MenuService;
import com.ligotop.core.exceptions.BusinessException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 系统菜单 服务实现类
 * </p>
 *
 * @author yudm
 * @since 2017-09-29
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {

    @Autowired
    private MenuMapper menuMapper;

    @Override
    public List<Menu> loadMenusByUserId(Integer userId) throws BusinessException {
        List<Menu> menus = menuMapper.findListByUserId(userId);
        return menus;
    }
}
